package com.shenzhen.horselive.network;



import io.reactivex.ObservableTransformer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

public class SchedulersCompat {

    private static final ObservableTransformer apiTransformer = upstream -> upstream.subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread()).map(new HttpResultFunc());

    private static final ObservableTransformer ioTransformer = upstream -> upstream.subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread());



    public static <T> ObservableTransformer<T, T> applyApiSchedulers() {
        return apiTransformer;
    }



    public static <T> ObservableTransformer<T, T> applyIoSchedulers() {
        return ioTransformer;
    }



}